<template>
  <div>

  </div>
</template>
<script>
export default {
  data() {
    return {
      userid:'',
      orgcode:'',
      isAndroid:false
    };
  },
  created()
  {

  },
  methods: {
    initglobal(){
      this.isAndroid=this.isAndroid_ios();
      console.log("init isandroid ==>"+this.isAndroid)
      debugger
      if(this.isAndroid){
        console.warn("is==================> android==>"+this.isAndroid)
      }else{
        console.warn("is not ==================> android==>"+this.isAndroid)
      }
      if(this.userid==''||this.userid==undefined){
        this.userid="123456";
        console.warn("userid==>"+this.userid)
      }
      if(this.orgcode==''||this.orgcode==undefined){
        this.orgcode="654321";
        console.warn("orgcode==>"+this.orgcode)
      }
    },
    isAndroid_ios(){
      //android is true else is false
      var u = navigator.userAgent,
        app = navigator.appVersion;
      var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
      var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
      return isAndroid == true ? true : false;
    },
    goBack() {
    	console.log(this.title);
      var backUrl=this.title.backUrl;
      console.log("title==>"+backUrl)
      if(backUrl!=undefined&&backUrl!=null&&backUrl!='null'&&backUrl!=''){
      	  if(backUrl=="/index"){
      	  	window.android.destory();
      	  }else{
      	  	 this.$router.push(backUrl);
      	  }
      }else{
      	 this.$router.go(-1); //返回上一次历史记录
      }
    }
  },mounted:function () {
	  window.goBack = this.goBack;//返回
  }
};
</script>

